Skip to content

feat(invoice): add formatSplitPercentage helper for basis-point percentages (#620) - #783

Merged
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
ZacLou:feat/format-split-percentage-620
Aug 30, 2026
Merged

feat(invoice): add formatSplitPercentage helper for basis-point percentages (#620)#783
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
ZacLou:feat/format-split-percentage-620

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 29, 2026

Copy link
Copy Markdown

Implements formatSplitPercentage as requested in #620.

  • Converts a basis-point value (0–10000) to a human-readable percentage string.
  • Configurable decimal places (0–4, default 2).
  • Throws SdkError with INVALID_RECIPIENT for out-of-range basis points.
  • Throws RangeError for invalid decimal places.
  • Exported from src/index.ts and covered by unit tests.

Closes #620

…tellar-split#620)

- Add formatSplitPercentage(basisPoints, opts?) to invoice/calculator.ts
- Convert 0-10000 bps to human-readable percent with configurable decimals (0-4)
- Throw SdkError.INVALID_RECIPIENT for out-of-range bps
- Throw RangeError for invalid decimals
- Export from index.ts and add unit tests

Closes Stellar-split#620
@Kingsman-99
Kingsman-99 merged commit aab9356 into Stellar-split:main Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add formatSplitPercentage from basis points to invoice/calculator.ts

2 participants